package g.beny.manage.action;

import g.beny.framework.web.ActionSupport;
import g.beny.manage.bean.Resource;
import g.beny.manage.services.ResourceService;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Param;

@At("/Resource")
@IocBean
public class ResourceAction extends ActionSupport{
	@Inject
    private ResourceService  resourceService;
	
	@At
	public Object list(@Param("page") int page ,@Param("rows") int rows){
		return resourceService.list(page,rows);
	}
	
	@At
	public boolean add(@Param("..") Resource obj){
		return resourceService.add(obj);
	}
	
	@At
	public boolean delete(@Param("..") Resource obj){
		return resourceService.delete(obj);
	}
	
	@At
	public boolean update(@Param("..") Resource obj){
		return resourceService.update(obj);
	}
}